var n = getApp(), t = require("../../api.js");

Page({
    data: {
        img: ""
    },
    onLoad: function(n) {},
    onReady: function() {},
    imgs: function() {
        wx.previewImage({
            current: this.data.img,
            urls: [ this.data.img ]
        });
    },
    onShow: function() {
        var o = this;
        n.request({
            url: t.distribution.getQrcode,
            method: "post",
            data: {},
            success: function(n) {
                1 == n.code ? o.setData({
                    img: n.data.img
                }) : wx.showToast({
                    title: n.msg,
                    icon: "none",
                    duration: 2e3
                });
            }
        });
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});